package org.xxd.kafka.clients.producer;

import org.xxd.kafka.clients.common.Cluster;

/**
 * @author: XiaoDong.Xie
 * @create: 2020-09-27 11:25
 * @description: 数据路由到哪个分区 分区器
 */
public interface Partitioner {

    /**
     * 获取路由到哪个分区
     * @param topic
     * @param key
     * @param value
     * @param cluster
     * @return
     */
    int partition(String topic, String key, String value, Cluster cluster);
}
